/*
 Navicat Premium Data Transfer

 Source Server         : localhost
 Source Server Type    : MySQL
 Source Server Version : 50726
 Source Host           : localhost:3306
 Source Schema         : trgzs

 Target Server Type    : MySQL
 Target Server Version : 50726
 File Encoding         : 65001

 Date: 17/10/2020 20:14:07
*/

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for sys_office
-- ----------------------------
DROP TABLE IF EXISTS `sys_office`;
CREATE TABLE `sys_office` (
  `id` varchar(64) NOT NULL COMMENT '编号',
  `name` varchar(100) NOT NULL COMMENT '名称',
  `type` char(1) NOT NULL DEFAULT '2' COMMENT '类型（1/学校或者2/学院）',
  `create_by` varchar(64) NOT NULL COMMENT '创建者',
  `create_date` datetime NOT NULL COMMENT '创建时间',
  `update_by` varchar(64) NOT NULL COMMENT '更新者',
  `update_date` datetime NOT NULL COMMENT '更新时间',
  `remarks` varchar(255) DEFAULT NULL COMMENT '备注信息',
  `del_flag` char(1) NOT NULL DEFAULT '0' COMMENT '删除标记',
  PRIMARY KEY (`id`) USING BTREE,
  KEY `sys_office_del_flag` (`del_flag`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='机构表';

-- ----------------------------
-- Records of sys_office
-- ----------------------------
BEGIN;
INSERT INTO `sys_office` VALUES ('1', '广东技术师范大学天河学院', '1', '1', '2013-05-27 08:00:00', '1', '2013-05-27 08:00:00', NULL, '0');
INSERT INTO `sys_office` VALUES ('31', '工商管理学院', '2', '1', '2019-08-05 08:46:38', '1', '2019-08-05 08:46:42', NULL, '0');
INSERT INTO `sys_office` VALUES ('32', '电气与电子工程学院', '2', '1', '2019-08-05 08:46:38', '1', '2019-08-05 08:46:42', NULL, '0');
INSERT INTO `sys_office` VALUES ('33', '机电工程学院', '2', '1', '2019-08-05 08:46:38', '1', '2019-08-05 08:46:42', NULL, '0');
INSERT INTO `sys_office` VALUES ('34', '艺术学院', '2', '1', '2019-08-05 08:46:38', '1', '2019-08-05 08:46:42', NULL, '0');
INSERT INTO `sys_office` VALUES ('35', '计算机科学与工程学院', '2', '1', '2019-08-05 08:46:38', '1', '2019-08-05 08:46:42', NULL, '0');
INSERT INTO `sys_office` VALUES ('36', '继续教育学院', '2', '1', '2019-08-05 08:46:38', '1', '2019-08-05 08:46:42', NULL, '0');
INSERT INTO `sys_office` VALUES ('37', '外国语学院', '2', '1', '2019-08-05 08:46:38', '1', '2019-08-05 08:46:42', NULL, '0');
INSERT INTO `sys_office` VALUES ('38', '国际教育学院', '2', '1', '2019-08-05 08:46:38', '1', '2019-08-05 08:46:42', NULL, '0');
INSERT INTO `sys_office` VALUES ('39', '建筑工程学院', '2', '1', '2019-08-05 08:46:38', '1', '2019-08-05 08:46:42', NULL, '0');
INSERT INTO `sys_office` VALUES ('40', '经济管理学院', '2', '1', '2019-08-05 08:46:38', '1', '2019-08-05 08:46:42', NULL, '0');
INSERT INTO `sys_office` VALUES ('41', '通识教育学院', '2', '1', '2019-08-05 08:46:38', '1', '2019-08-05 08:46:42', NULL, '0');
INSERT INTO `sys_office` VALUES ('42', '中兴通讯信息工程学院', '2', '1', '2019-10-29 16:34:45', '1', '2019-10-29 16:34:49', NULL, '0');
COMMIT;

-- ----------------------------
-- Table structure for sys_permission
-- ----------------------------
DROP TABLE IF EXISTS `sys_permission`;
CREATE TABLE `sys_permission` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `permission` varchar(40) DEFAULT NULL,
  `description` varchar(50) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='权限表';

-- ----------------------------
-- Records of sys_permission
-- ----------------------------
BEGIN;
INSERT INTO `sys_permission` VALUES (3, 'teacher-list', '教师列表');
INSERT INTO `sys_permission` VALUES (4, 'student-list', '学生列表');
INSERT INTO `sys_permission` VALUES (6, 'permission-list', '权限列表');
INSERT INTO `sys_permission` VALUES (7, 'permission-edit', '权限编辑');
INSERT INTO `sys_permission` VALUES (8, 'role-list', '角色列表');
INSERT INTO `sys_permission` VALUES (9, 'role-edit', '角色编辑');
INSERT INTO `sys_permission` VALUES (10, 'user-list', '用户列表');
INSERT INTO `sys_permission` VALUES (11, 'user-edit', '用户编辑');
INSERT INTO `sys_permission` VALUES (12, 'coach-list', '辅导员列表');
COMMIT;

-- ----------------------------
-- Table structure for sys_role
-- ----------------------------
DROP TABLE IF EXISTS `sys_role`;
CREATE TABLE `sys_role` (
  `id` varchar(64) NOT NULL COMMENT '编号',
  `name` varchar(100) NOT NULL COMMENT '角色名称',
  `enname` varchar(255) DEFAULT NULL COMMENT '英文名称',
  `create_by` varchar(64) NOT NULL COMMENT '创建者',
  `create_date` datetime NOT NULL COMMENT '创建时间',
  `update_by` varchar(64) NOT NULL COMMENT '更新者',
  `update_date` datetime NOT NULL COMMENT '更新时间',
  `remarks` varchar(255) DEFAULT NULL COMMENT '备注信息',
  `del_flag` char(1) NOT NULL DEFAULT '0' COMMENT '删除标记',
  PRIMARY KEY (`id`) USING BTREE,
  KEY `sys_role_del_flag` (`del_flag`) USING BTREE,
  KEY `sys_role_enname` (`enname`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='角色表';

-- ----------------------------
-- Records of sys_role
-- ----------------------------
BEGIN;
INSERT INTO `sys_role` VALUES ('1', '系统管理员', 'sysManager', '1', '2013-05-27 08:00:00', '1', '2013-05-27 08:00:00', NULL, '0');
INSERT INTO `sys_role` VALUES ('3', '学生', 'stu', '1', '2013-05-27 08:00:00', '1', '2013-05-27 08:00:00', NULL, '0');
INSERT INTO `sys_role` VALUES ('5', '心理咨询师', 'tea', '1', '2013-05-27 08:00:00', '1', '2013-05-27 08:00:00', NULL, '0');
INSERT INTO `sys_role` VALUES ('6', '管理员', 'manager', '1', '2019-08-05 09:08:41', '1', '2019-08-05 09:08:45', NULL, '0');
INSERT INTO `sys_role` VALUES ('7', '辅导员', 'coach', '1', '2013-05-27 08:00:00', '1', '2013-05-27 08:00:00', NULL, '0');
COMMIT;

-- ----------------------------
-- Table structure for sys_role_permission
-- ----------------------------
DROP TABLE IF EXISTS `sys_role_permission`;
CREATE TABLE `sys_role_permission` (
  `id` varchar(64) NOT NULL,
  `role_id` varchar(64) NOT NULL,
  `permission_id` varchar(64) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='角色权限';

-- ----------------------------
-- Records of sys_role_permission
-- ----------------------------
BEGIN;
INSERT INTO `sys_role_permission` VALUES ('10', '1', '8');
INSERT INTO `sys_role_permission` VALUES ('11', '1', '9');
INSERT INTO `sys_role_permission` VALUES ('12', '1', '10');
INSERT INTO `sys_role_permission` VALUES ('13', '1', '11');
INSERT INTO `sys_role_permission` VALUES ('18', '3', '4');
INSERT INTO `sys_role_permission` VALUES ('19', '5', '3');
INSERT INTO `sys_role_permission` VALUES ('20', '6', '8');
INSERT INTO `sys_role_permission` VALUES ('21', '7', '12');
INSERT INTO `sys_role_permission` VALUES ('22', '6', '9');
INSERT INTO `sys_role_permission` VALUES ('23', '6', '10');
INSERT INTO `sys_role_permission` VALUES ('24', '6', '11');
INSERT INTO `sys_role_permission` VALUES ('25', '6', '6');
INSERT INTO `sys_role_permission` VALUES ('26', '6', '7');
INSERT INTO `sys_role_permission` VALUES ('8', '1', '6');
INSERT INTO `sys_role_permission` VALUES ('9', '1', '7');
COMMIT;

-- ----------------------------
-- Table structure for sys_user
-- ----------------------------
DROP TABLE IF EXISTS `sys_user`;
CREATE TABLE `sys_user` (
  `id` varchar(64) NOT NULL COMMENT '编号',
  `company_id` varchar(64) NOT NULL COMMENT '归属公司',
  `office_id` varchar(64) NOT NULL COMMENT '归属部门',
  `username` varchar(100) NOT NULL COMMENT '登录名',
  `password` varchar(100) NOT NULL COMMENT '密码',
  `no` varchar(100) DEFAULT NULL COMMENT '工号',
  `name` varchar(100) NOT NULL COMMENT '姓名',
  `email` varchar(200) DEFAULT NULL COMMENT '邮箱',
  `phone` varchar(200) DEFAULT NULL COMMENT '电话',
  `sex` char(1) NOT NULL DEFAULT '0' COMMENT '性别',
  `birthday` varchar(20) DEFAULT NULL COMMENT '生日',
  `second_password` varchar(64) DEFAULT NULL COMMENT '二次密码',
  `login_ip` varchar(100) DEFAULT NULL COMMENT '最后登陆IP',
  `login_date` datetime DEFAULT NULL COMMENT '最后登陆时间',
  `login_flag` char(1) DEFAULT NULL COMMENT '是否可登录',
  `create_by` varchar(64) NOT NULL COMMENT '创建者',
  `create_date` datetime NOT NULL COMMENT '创建时间',
  `update_by` varchar(64) NOT NULL COMMENT '更新者',
  `update_date` datetime NOT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  `remarks` varchar(255) DEFAULT NULL COMMENT '备注信息',
  `del_flag` char(1) NOT NULL DEFAULT '0' COMMENT '删除标记',
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE KEY `uk_username` (`username`) USING BTREE,
  KEY `sys_user_office_id` (`office_id`) USING BTREE,
  KEY `sys_user_company_id` (`company_id`) USING BTREE,
  KEY `sys_user_update_date` (`update_date`) USING BTREE,
  KEY `sys_user_del_flag` (`del_flag`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='用户表';

-- ----------------------------
-- Records of sys_user
-- ----------------------------
BEGIN;
INSERT INTO `sys_user` VALUES ('1', '1', '2', 'trgzs', '02a3f0772fcca9f415adc990734b45c6f059c7d33ee28362c4852032', '0001', '系统管理员', 'thinkgem@163.com', '8675', '0', NULL, NULL, '0:0:0:0:0:0:0:1', '2019-11-10 21:05:51', '1', '1', '2013-05-27 08:00:00', '1', '2020-10-17 20:11:51', '最高管理员', '0');
COMMIT;

-- ----------------------------
-- Table structure for sys_user_role
-- ----------------------------
DROP TABLE IF EXISTS `sys_user_role`;
CREATE TABLE `sys_user_role` (
  `user_id` varchar(64) NOT NULL COMMENT '用户编号',
  `role_id` varchar(64) NOT NULL COMMENT '角色编号',
  PRIMARY KEY (`user_id`,`role_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='用户-角色';

-- ----------------------------
-- Records of sys_user_role
-- ----------------------------
BEGIN;
INSERT INTO `sys_user_role` VALUES ('1', '1');
INSERT INTO `sys_user_role` VALUES ('1', '2');
COMMIT;

-- ----------------------------
-- Table structure for sys_user_wx
-- ----------------------------
DROP TABLE IF EXISTS `sys_user_wx`;
CREATE TABLE `sys_user_wx` (
  `id` varchar(64) NOT NULL COMMENT '微信登录id',
  `user_id` varchar(64) NOT NULL COMMENT '用户id',
  `open_id` varchar(64) NOT NULL,
  `session_key` varchar(64) NOT NULL,
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE KEY `user_id_unique` (`user_id`) USING BTREE COMMENT '用户id唯一',
  UNIQUE KEY `open_id` (`open_id`) USING BTREE COMMENT 'openId唯一'
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='用户微信绑定';

-- ----------------------------
-- Records of sys_user_wx
-- ----------------------------
BEGIN;
INSERT INTO `sys_user_wx` VALUES ('fffd494f34a442a0a89d4ae684fe7f4b', '1da34dcf6442490e9d414e03ed8bc816', 'oloPH5bGd_xfHA2IRdS-UN3EApVk', 'Ow7/AVIrNFp4D+VpvlKEHQ==');
COMMIT;

SET FOREIGN_KEY_CHECKS = 1;
